Thanks for downloading the WebSafe Plugin. The plugin has two functions:
CheckWebSafe(checkColor as Color) as Boolean
SnapWebSafe(snapColor as Color) as Color
• CheckWebSafe takes an RB color and checks whether or not it's one of the 216 web-safe colors, which show up identically on most computer platforms/web-browsers. If the color is web-safe, the function returns true. Otherwise, false.
• SnapWebSafe also takes an RB color, and automatically 'snaps to' the nearest web-safe color. This is useful for web graphic apps, and is exactly what Photoshop does in a more general way when you click the 'out of gamut' warning icon. The nearest web-safe color is returned from this function.
Both functions incorporate range-checking (even though RB actually takes care of that part for you; RB makes sure that all color component values are within the range 0-255, and inserts the value of zero if you try to pass characters to a color).
The WebSafe Plugin is FAT, only about 7k in size, free for anyone, and is currently Mac-only. I'll support Windows in the next version. The plugin comes with an example project and this Read Me text file. You can check for new versions at my personal website:
<http://www.mattman.net>
Please send comments or bug reports to me, Matt Ridley, at the email address above.